package com.atguigu.decorator;


/**
 * @author LYJ
 * @Description
 * @date 2021 年 10 月 11 日 下午5:43
 */
public class Client {
    public static void main(String[] args) {
//
//        Drink drink = new Espresso();
//        drink = new Milk(drink);
//        drink = new Milk(drink);
//        System.out.println(drink.cost());

        //一份espresso + 牛奶
//        Decorator decorator = new Milk(new Espresso());
//        System.out.println(decorator.cost());


        Drink longBlack = new LongBlack();
        longBlack = new Milk(longBlack);
        longBlack = new Sugar(longBlack);
        System.out.println(longBlack.cost());

    }
}
